package IOstreams;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileOutputStreamTest {
    public static void main(String[] args) {
        File file = new File("ChapterLearning/a.txt");
        try (FileOutputStream out = new FileOutputStream(file,true)) {
            out.write(97);
            out.write(",hello,word!".getBytes());
            out.flush();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
